package com.ttx.pattern.example.strategy.after;

/**
 * 上下文，承载算法
 * 
 * @author TimFruit
 * @date 2019/5/21 8:03
 */

public class Calculator {
    IAlgorithm algorithm;

    public Calculator(IAlgorithm algorithm) {
        this.algorithm = algorithm;
    }
    
    
    public int exec(int num1, int num2){
        return algorithm.doOperate(num1, num2);
    }
}
